import request from '@/utils/request';
import { getCurrentInstance } from 'vue';
const errortips =
  getCurrentInstance()?.appContext.config.globalProperties.$errortips;

/**
 * 分页查询用户
 */
export async function get_sales_manage_list(params) {
  const res = await request.post('/order/sales_manage/order_list', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data.data;
  }
  return Promise.reject(res.data.msg);
}

//零售单详情
export async function get_sales_manage_detail(params) {
  const res = await request.post('/order/sales_manage/detail', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data.data;
  }
  return Promise.reject(res.data.msg);
}
//零售单编辑
export async function get_sales_manage_edit(params) {
  const res = await request.post('/order/sales_manage/edit', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data;
  }
  return Promise.reject(res.data.msg);
}
//零售单导出
export async function export_order_list(params) {
  const res = await request.post('/order/sales_manage/order_list', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data.data;
  }
  return Promise.reject(res.data.msg);
}
